package demo.CardDemo;

/**
 * 卡类
 *
 * Version: 1.0
 * Author: 瓶子
 */
// @Data  //自动生成无参构造函数、getter、setter、toString方法
// @NoArgsConstructor    // 自动生成无参构造函数
// @AllArgsConstructor   // 自动生成有参构造函数
public class Card {
    private String cardId; // 车牌
    private String Name;
    private String phoneNumber;
    private double money;

    public Card() {
    }

    public Card( String cardId, String name, String phoneNumber, double money ) {
        this.cardId = cardId;
        Name = name;
        this.phoneNumber = phoneNumber;
        this.money = money;
    }

    public String getCardId() {
        return cardId;
    }

    public void setCardId( String cardId ) {
        this.cardId = cardId;
    }

    public String getName() {
        return Name;
    }

    public void setName( String name ) {
        Name = name;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber( String phoneNumber ) {
        this.phoneNumber = phoneNumber;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney( double money ) {
        this.money = money;
    }

    // 所有的卡都有预存金额，消费金额。
    // 消费金额
    public void consume(double money) {
        this.money -= money;
    }
    // 预存
    public void preStore(double money) {
        this.money += money;
    }
}
